﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;

namespace GraphViewer.Configuration
{
    public class SystemConfigurationElement : BaseConfigurationElement
    {
        [ConfigurationProperty("id", IsRequired = true)]
        public string Id
        {
            get
            {
                return (string)this["id"];
            }
            set
            {
                this["id"] = value;
            }
        }

        [ConfigurationProperty("name", IsRequired = false)]
        public string Name
        {
            get
            {
                return (string)this["name"];
            }
            set
            {
                this["name"] = value;
            }
        }

        [ConfigurationProperty("controlM", IsRequired = true)]
        [ConfigurationCollection(typeof(ControlMConfigurationElement), AddItemName = "add")]
        public ConfigurationCollection<ControlMConfigurationElement> ControlM
        {
            get
            {
                return (ConfigurationCollection<ControlMConfigurationElement>)this["controlM"];
            }
        }
        
        [ConfigurationProperty("processes", IsRequired = false)]
        [ConfigurationCollection(typeof(ProcessConfigurationElement), AddItemName = "add")]
        public ConfigurationCollection<ProcessConfigurationElement> Processes
        {
            get
            {
                return (ConfigurationCollection<ProcessConfigurationElement>)this["processes"];
            }
        }

        [ConfigurationProperty("externalDependencies", IsRequired = false)]
        [ConfigurationCollection(typeof(ConfigurationCollection<DependencyConfigurationElement>), AddItemName = "add")]
        public ConfigurationCollection<DependencyConfigurationElement> ExternalDependencies
        {
            get
            {
                return (ConfigurationCollection<DependencyConfigurationElement>)this["externalDependencies"];
            }
        }
    }
}
